<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>按钮测试</title>
    <style>
        body { font-family: Arial, sans-serif; margin: 2rem; }
        button { padding: 10px 20px; margin: 10px; cursor: pointer; }
        .log { margin-top: 20px; padding: 10px; border: 1px solid #ccc; }
    </style>
</head>
<body>
    <h2>按钮功能测试</h2>
    <button onclick="testClick('匿名记录')">测试匿名记录</button>
    <button onclick="testClick('同意记录')">测试同意记录</button>
    <button onclick="testGPS()">测试GPS功能</button>
    
    <div class="log" id="result">点击按钮查看结果...</div>

    <script>
        function testClick(type) {
            document.getElementById('result').innerHTML = `按钮点击成功：${type}<br>时间：${new Date().toLocaleString()}`;
        }

        function testGPS() {
            if (navigator.geolocation) {
                document.getElementById('result').innerHTML = '正在获取GPS...';
                navigator.geolocation.getCurrentPosition(
                    (pos) => {
                        document.getElementById('result').innerHTML = 
                            `GPS获取成功：<br>` +
                            `纬度：${pos.coords.latitude}<br>` +
                            `经度：${pos.coords.longitude}<br>` +
                            `精度：${pos.coords.accuracy}米`;
                    },
                    (err) => {
                        document.getElementById('result').innerHTML = `GPS错误：${err.message}`;
                    }
                );
            } else {
                document.getElementById('result').innerHTML = '浏览器不支持GPS';
            }
        }
    </script>
</body>
</html>